Mass exchange model for relative permeability simulation

ABSTRACT

This description relates to computer simulation of physical processes, such as computer simulation of multi-species flow through porous media including the determination/estimation of relative permeabilities for the multi-species flow through the porous media.

CLAIM OF PRIORITY

This application claims priority under 35 USC §119(e) to U.S.Provisional Patent Application Ser. No. 61/824,100, filed on May 16,2013 and entitled “Mass Sink/source Model for Capturing History Effectsin Relative Permeability Simulations,” the entire contents of which arehereby incorporated by reference.

TECHNICAL FIELD

This description relates to computer simulation of physical processes,such as computer simulation of multi-species flow through porous mediaincluding the determination/estimation of relative permeabilities forthe multi-species flow through the porous media.

BACKGROUND

Hydrocarbons found underground are typically present in rock formations.These rock formations are usually porous to some respect and can beclassified as porous media. Hydrocarbon extraction from this porousmedia is often performed using a fluid (e.g., water) immiscible with thehydrocarbon. To understand hydrocarbon extraction from a porous media,simulations are used to characterize the porous media and the flowthrough the porous media.

SUMMARY

In general, this document describes techniques for simulatingmulti-species flow through porous media where the simulation isperformed at different saturations. The simulations described herein usea mass sink/source method in which fluid mass is exchanged between thedifferent species at a selected subset of locations (e.g., voxels). Inthis manner the saturation can be changed while much of the spatialdistribution of the fluid species from the previous saturation conditionremains unchanged; hence information from the simulation results at onesaturation condition influences the simulation at another saturationcondition.

In one general aspect, a computer-implemented method for simulating amulti-species flow through porous media includes simulating activity ofa multi-phase fluid that includes a first species and a second speciesin a volume, the activity of the fluid in the volume being simulated soas to model movement of elements within the volume, determining arelative permeability of the first species in the volume for a firstsaturation value, and removing, from identified exchange regions, afirst mass of the first species and replacing the first mass of thefirst species with a second mass of the second species to modify asaturation value for the volume. The method also includes simulatingactivity of the multi-phase fluid based on the modified saturation valueand determining a relative permeability of the first species in thevolume based on the modified saturation value.

Embodiments can include one or more of the following.

The method can also include identifying the exchange regions in thevolume, based on a value indicative of movement of the first specieswithin the volume.

Identifying the exchange regions can include identifying a set ofconvective voxels.

Identifying the convective voxels in the volume can include identifyingvoxels having a high flow rate of the first species.

Identifying the convective voxels in the volume comprises identifyingvoxels in which a velocity exceeds a threshold.

Identifying the convective voxels in the volume can include rankingvoxels based on their associated velocity and selecting a portion of thevoxels having the greatest velocity.

Removing the first mass of the first species and replacing the firstmass of the first species with the second mass of the second species caninclude replacing the first mass of the first species with an equal massof the second species.

Removing, from the identified exchange regions, the first mass of thefirst species and replacing the first mass of the first species with theequal mass of the second species can include performing a mass exchangeprocess over multiple time steps until a desired saturation value isobtained.

Simulating the activity of the multi-phase fluid can include simulatingthe activity of the multi-phase fluid until the effective permeabilitiesconverge.

The first species can be oil and the second species can be water.

The volume can be a porous media volume.

Simulating the activity of the multi-phase fluid can include simulatingthe activity of the multi-phase fluid in a periodic domain using agravity driven simulation.

Simulating activity of the fluid in the volume can include performinginteraction operations on the state vectors, the interaction operationsmodeling interactions between elements of different momentum statesaccording to a model and performing first move operations of the set ofstate vectors to reflect movement of elements to new voxels in thevolume according to the model.

Implementations of the techniques discussed above may include a methodor process, a system or apparatus, or computer software on acomputer-accessible medium.

In some additional aspects, a method for estimating the productivity ofa hydrocarbon reservoir includes simulating activity of a multi-phasefluid that includes at least oil and water in a hydrocarbon reservoir,the activity of the fluid in the hydrocarbon reservoir being simulatedso as to model movement of elements within the hydrocarbon reservoir,determining a relative permeability of oil and a relative permeabilityof water in the hydrocarbon reservoir for a first saturation value,removing, from identified exchange regions, a first mass of the oil andreplacing the first mass of the oil with a second mass of water tomodify a saturation value for the volume, simulating activity of themulti-phase fluid based on the modified saturation value, determining arelative permeability of oil and a relative permeability of water in thehydrocarbon reservoir based on the modified saturation value, andestimating of the amount of oil which can be produced from thehydrocarbon reservoir based on the determined relative permeabilities.

Implementations of the techniques discussed above may include a methodor process, a system or apparatus, or computer software on acomputer-accessible medium.

The systems and method and techniques may be implemented using varioustypes of numerical simulation approaches such as the Shan-Chen methodfor multi-phase flow and the Lattice Boltzmann formulation. Furtherinformation about the Lattice Boltzmann formulation will be describedherein. However, the systems and techniques described herein are notlimited to simulations using the Lattice Boltzmann formulation and canbe applied to other numerical simulation approaches.

The systems and techniques may be implemented using a lattice gassimulation that employs a Lattice Boltzmann formulation The traditionallattice gas simulation assumes a limited number of particles at eachlattice site, with the particles being represented by a short vector ofbits. Each bit represents a particle moving in a particular direction.For example, one bit in the vector might represent the presence (whenset to 1) or absence (when set to 0) of a particle moving along aparticular direction. Such a vector might have six bits, with, forexample, the values 110000 indicating two particles moving in oppositedirections along the X axis, and no particles moving along the Y and Zaxes. A set of collision rules governs the behavior of collisionsbetween particles at each site (e.g., a 110000 vector might become a001100 vector, indicating that a collision between the two particlesmoving along the X axis produced two particles moving away along the Yaxis). The rules are implemented by supplying the state vector to alookup table, which performs a permutation on the bits (e.g.,transforming the 110000 to 001100). Particles are then moved toadjoining sites (e.g., the two particles moving along the Y axis wouldbe moved to neighboring sites to the left and right along the Y axis).

In an enhanced system, the state vector at each lattice site includesmany more bits (e.g., 54 bits for subsonic flow) to provide variation inparticle energy and movement direction, and collision rules involvingsubsets of the full state vector are employed. In a further enhancedsystem, more than a single particle is permitted to exist in eachmomentum state at each lattice site, or voxel (these two terms are usedinterchangeably throughout this document). For example, in an eight-bitimplementation, 0-255 particles could be moving in a particulardirection at a particular voxel. The state vector, instead of being aset of bits, is a set of integers (e.g., a set of eight-bit bytesproviding integers in the range of 0 to 255), each of which representsthe number of particles in a given state.

In a further enhancement, Lattice Boltzmann Methods (LBM) use amesoscopic representation of a fluid to simulate 3D unsteadycompressible turbulent flow processes in complex geometries at a deeperlevel than possible with conventional computational fluid dynamics(“CFD”) approaches. A brief overview of LBM method is provided below.

Boltzmann-Level Mesoscopic Representation

It is well known in statistical physics that fluid systems can berepresented by kinetic equations on the so-called “mesoscopic” level. Onthis level, the detailed motion of individual particles need not bedetermined. Instead, properties of a fluid are represented by theparticle distribution functions defined using a single particle phasespace, ƒ=ƒ(x, v, t), where x is the spatial coordinate while v is theparticle velocity coordinate. The typical hydrodynamic quantities, suchas mass, density, fluid velocity and temperature, are simple moments ofthe particle distribution function. The dynamics of the particledistribution functions obeys a Boltzmann equation:

∂_(t) ƒ+v∇ _(x) ƒ+F(x,t)∇_(v) ƒ=C{ƒ},  Eq. (1)

where F(x,t) represents an external or self-consistently generatedbody-force at (x, t). The collision term C represents interactions ofparticles of various velocities and locations. It is important to stressthat, without specifying a particular form for the collision term C, theabove Boltzmann equation is applicable to all fluid systems, and notjust to the well-known situation of rarefied gases (as originallyconstructed by Boltzmann).

Generally speaking, C includes a complicated multi-dimensional integralof two-point correlation functions. For the purpose of forming a closedsystem with distribution functions ƒ alone as well as for efficientcomputational purposes, one of the most convenient and physicallyconsistent forms is the well-known BGK operator. The BGK operator isconstructed according to the physical argument that, no matter what thedetails of the collisions, the distribution function approaches awell-defined local equilibrium given by {ƒ^(eq)(x,v,t)} via collisions:

$\begin{matrix}{{C = {{- \frac{1}{\tau}}( {f - f^{eq}} )}},} & {{Eq}.\mspace{14mu} (2)}\end{matrix}$

where the parameter τ represents a characteristic relaxation time toequilibrium via collisions. Dealing with particles (e.g., atoms ormolecules) the relaxation time is typically taken as a constant. In a“hybrid” (hydro-kinetic) representation, this relaxation time is afunction of hydrodynamic variables like rate of strain, turbulentkinetic energy and others. Thus, a turbulent flow may be represented asa gas of turbulence particles (“eddies”) with the locally determinedcharacteristic properties.

Numerical solution of the Boltzmann-BGK equation has severalcomputational advantages over the solution of the Navier-Stokesequations. First, it may be immediately recognized that there are nocomplicated nonlinear terms or higher order spatial derivatives in theequation, and thus there is little issue concerning advectioninstability. At this level of description, the equation is local sincethere is no need to deal with pressure, which offers considerableadvantages for algorithm parallelization. Another desirable feature ofthe linear advection operator, together with the fact that there is nodiffusive operator with second order spatial derivatives, is its ease inrealizing physical boundary conditions such as no-slip surface orslip-surface in a way that mimics how particles truly interact withsolid surfaces in reality, rather than mathematical conditions for fluidpartial differential equations (“PDEs”). One of the direct benefits isthat there is no problem handling the movement of the interface on asolid surface, which helps to enable lattice-Boltzmann based simulationsoftware to successfully simulate complex turbulent aerodynamics. Inaddition, certain physical properties from the boundary, such as finiteroughness surfaces, can also be incorporated in the force. Furthermore,the BGK collision operator is purely local, while the calculation of theself-consistent body-force can be accomplished via near-neighborinformation only. Consequently, computation of the Boltzmann-BGKequation can be effectively adapted for parallel processing.

Lattice Boltzmann Formulation

Solving the continuum Boltzmann equation represents a significantchallenge in that it entails numerical evaluation of anintegral-differential equation in position and velocity phase space. Agreat simplification took place when it was observed that not only thepositions but the velocity phase space could be discretized, whichresulted in an efficient numerical algorithm for solution of theBoltzmann equation. The hydrodynamic quantities can be written in termsof simple sums that at most depend on nearest neighbor information. Eventhough historically the formulation of the lattice Boltzmann equationwas based on lattice gas models prescribing an evolution of particles ona discrete set of velocities v(ε{c_(i), i=1, . . . , b}), this equationcan be systematically derived from the first principles as adiscretization of the continuum Boltzmann equation. As a result, LBEdoes not suffer from the well-known problems associated with the latticegas approach. Therefore, instead of dealing with the continuumdistribution function in phase space, ƒ(x, v, t), it is only necessaryto track a finite set of discrete distributions, ƒ_(i)(x, t) with thesubscript labeling the discrete velocity indices. The key advantage ofdealing with this kinetic equation instead of a macroscopic descriptionis that the increased phase space of the system is offset by thelocality of the problem.

Due to symmetry considerations, the set of velocity values are selectedin such a way that they form certain lattice structures when spanned inthe configuration space. The dynamics of such discrete systems obeys theLBE having the form ƒ_(i)(x+c_(i), t+1)−ƒ_(i)(x,t)=C_(i)(x,t), where thecollision operator usually takes the BGK form as described above. Byproper choices of the equilibrium distribution forms, it can betheoretically shown that the lattice Boltzmann equation gives rise tocorrect hydrodynamics and thermo-hydrodynamics. That is, thehydrodynamic moments derived from ƒ_(i)(x, t) obey the Navier-Stokesequations in the macroscopic limit. These moments are defined as:

$\begin{matrix}{{{{\rho ( {x,t} )} = {\sum\limits_{i}^{\;}{f_{i}( {x,t} )}}};}{{{\rho \; {u( {x,t} )}} = {\sum\limits_{i}^{\;}{c_{i}{f_{i}( {x,t} )}}}};}{{{{DT}( {x,t} )} = {\sum\limits_{i}^{\;}{( {c_{i} - u} )^{2}{f_{i}( {x,t} )}}}},}} & {{Eq}.\mspace{14mu} (3)}\end{matrix}$

where ρ, u, and T are, respectively, the fluid density, velocity andtemperature, and D is the dimension of the discretized velocity space(not at all equal to the physical space dimension).

Other features and advantages will be apparent from the followingdescription, including the drawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a periodic system of a vertical pore which has adead-end pore attached to it.

FIGS. 2A-2C illustrate effects in a pore in the exemplary system shownin FIG. 1 without the use of mass exchange hence history effects are notincluded. The initial fluid distribution is based on a process whichdistributes the density homogeneously across the entire fluid domain forevery single voxel.

FIGS. 3A-3C illustrate history effects in a pore in the exemplary systemshown in FIG. 1 with the use of mass exchange.

FIGS. 4 and 5 illustrate velocity components of two LBM models.

FIG. 6 is a flow chart of a procedure followed by a physical processsimulation system.

FIG. 7 is a perspective view of a microblock.

FIGS. 8A and 8B are illustrations of lattice structures used by thesystem of FIG. 6.

FIGS. 9 and 10 illustrate variable resolution techniques.

FIG. 11 illustrates regions affected by a facet of a surface.

FIG. 12 illustrates movement of particles from a voxel to a surface.

FIG. 13 illustrates movement of particles from a surface to a surface.

FIG. 14 is a flow chart of a procedure for performing surface dynamics.

FIG. 15 illustrates an interface between voxels of different sizes.

FIG. 16 is a flow chart of a procedure for simulating interactions withfacets under variable resolution conditions.

FIG. 17 is a flow chart of a procedure for determining relativepermeabilities at different saturation levels.

FIG. 18 is a flow chart of a procedure for mass exchange.

DESCRIPTION A. Approach to Relative Permeability Simulations

When completing complex fluid flow simulations of multi-species flowthrough porous media it can be beneficial to capture history effects.For example, when simulating hydrocarbon extraction from a rockformation it can be beneficial to include history effects to determinetrapped pockets or portion of hydrocarbon which do not move when fluidis injected into the formation.

In this regard, exemplary multi-species flow through porous media caninclude computer simulation of multi-species porous media flow throughreal reservoir rock samples. For example, hydrocarbons found undergroundare typically present in rock formations. These rock formations areusually porous to some respect and can be classified as porous media.Hydrocarbon extraction from this porous media is typically performedusing a fluid immiscible with the hydrocarbon such as water. Tounderstand hydrocarbon extraction from the porous media, the systems andmethods described herein characterize the porous media and the flowthrough it. In performing such simulations, the relative permeability ofthe different species within the system is important. Whereas absolutepermeability is a single scalar value and intrinsic to the pore spacegeometry, relative permeability in multi-species porous media flowanalysis is a collection of results showing how easily each speciesmoves as a function of the volume fraction (saturation) of the referencespecies (often water). The term “relative” is used to indicate that thepermeability of a species in the presence of multiple species isnormalized by the absolute permeability. A relative permeability plot isachieved when the permeability results for each species over theimportant range of saturation values are obtained. In such simulations,the porous media sample is captured digitally, typically via a CT ormicro-CT scanning process. Analysis and processing of the resultingimages can be used to generate a three-dimensional digitalrepresentation of the porous rock geometry for use in a numerical flowsimulation. A numerical method capable of handling multi-species flowcan then be used to simulate the flow through the sample for varioussaturation conditions to obtain predictions of flow behavior includingrelative permeability values. In the “steady-state” approach, for eachsaturation level, the simulation will be run until the effectivepermeabilities converge. After convergence, the mass source sink modelwill be turned on and the simulation will be run until the desiredsaturation level is achieved.

The systems and methods described herein provide a prediction ofrelative permeabilities for multi-species (e.g. at least two immisciblecomponents) flow through porous media. One exemplary numerical approachis the lattice-Boltzmann method (LBM), for which several differenttechniques exist for how to extend the usual single-fluid algorithm tobe capable of simulating multi-species flow. One of these techniques isknown as the Shan-Chen interaction force method. In someimplementations, a Shan-Chen-based multi-species LBM approach is used tosimulate multi-species flow through porous media to predict importantaspects of the flow behavior including relative permeabilities.

FIG. 1 shows a diagram of a vertical pore which has a dead-end poreattached to it. As shown in FIG. 1, in performing numerical simulationof multi-species flow through digital porous media, one way to set upthe simulation is to use a periodic domain in the flow direction (e.g.,by including periodic boundary conditions). With this method, there isno inlet or outlet for the fluid to enter and exit, but rather the fluidleaving one end of the domain 12 immediately enters at the other end 14.Thus, any object/species which leaves the simulation cell on one sideenters back on the other. More particularly, when an object passesthrough a voxel at an outlet end of the simulation space (e.g., 12), itreappears at a corresponding voxel at the inlet (e.g., 14) with the samevelocity and direction. To move the fluid through the simulation domaina body force is applied in the desired flow direction. This body forceis analogous to (and often labeled) gravity. One potential advantage ofa periodic setup is that it avoids the “end effects” that occur whenfluids move through the interface between a porous medium and a bulkfluid region; these end effects can have an undesirable impact on thepredicted permeability from a simulation.

As noted above, when modeling the multi-phase systems described herein,it is important to determine the effects on the relative permeability ofeach of the species in the system over a range of saturation valuesbecause the relative permeabilities differ for different saturationvalues. For example, it can be desirable to simulate/determine therelative permeabilities for about 0% saturation, about 20% saturation,about 40% saturation, about 60% saturation, and about 80% saturation,but the choice of saturation levels depends on the rock and also theprocess the user selected, e.g. a priori fixed Sw versus adaptive Sw.The user may select to simulate only a portion of the possiblesaturation level.

One method to modify the saturation (e.g., modify the ratio of thevarious species in the system) is to simply add a desired amount of eachof the species into an inlet of the system (e.g., a non-periodicsystem). However, this method does not provide the stability andcomputational efficiency benefits of a periodic system as the body forcepulls the entire domain simultaneously toward its final state. As such,a method for modifying the saturation value while allowing the system tobe simulated as a periodic system is believed to be desirable.

Another method to modify the saturation is to perform multiple, separatesimulations. Each initialized with the desired saturation value. FIGS.2A-2C provides an illustration of a set of gravity driven periodic-setupsimulations performed at different saturations (e.g., 20% is shown inFIG. 2A, 40% is shown in FIG. 2B, and 55% is shown in FIG. 2C). In theexemplary system shown in the simulations shown in FIG. 2A-2C, thesystem includes a dead-end pore 18. When fluid flows from the inlet 14to the outlet 12, the fluid trapped in the dead-end port 18 remainstrapped (e.g., non-mobile). In this example, in order to simulate thedifferent saturations, the simulation for each saturation value would becarried out with the same initial condition and independent of theresults of the simulations at other saturation values. This meansinformation about where the different fluid species existed in onesimulation does not influence any of the other saturation levelsimulations (covering the desired range of saturation values). As aresult, no history/hysteresis effects were captured in the relativepermeability predictions. As can be seen in this example, such asimulation which lacks history/hysteresis results in the fluid in thedead-end pore 18 assuming the same saturation value as the fluid in thesystem overall. However, such a result is not physically obtainablesince the fluid within the dead-end pore 18 is trapped.

The systems and methods described herein provide a periodic system inwhich simulations at different saturation levels retained historicalinformation from previously simulated saturation levels. FIGS. 3A-3Cprovide an illustration of a set of gravity driven periodic-setupsimulations performed at different saturations performed using the massexchange methods described herein (e.g., 20% is shown in FIG. 3A, 40% isshown in FIG. 3B, and 55% is shown in FIG. 3C). In the exemplary systemshown in the simulations shown in FIG. 3A-3C, the system includes adead-end pore 18. However, the mass exchange process captureshistory/hysteresis effects in the relative permeability predictions suchthat the fluid trapped in the dead-end pore 18 remains trapped (e.g.,the species is present in the dead-end pore 18 but motionless) and therelative saturation of the fluid in the dead-end pore 18 does notchange. For example, if the system is initialized with 80% oil and 20%water, when the second simulation at 60% oil and 40% water thisperformed, the percentage of oil within the dead in the pore 18 remainsat the initialization percentage of 80% while the percentage of oil inother regions of the system is reduced to a value less than 60%, suchthat the overall saturation value is 60%. In order to modify thesaturation in a physically meaningful manner, the saturation value ismodified by replacing a portion of the first species (e.g., oil) withthe second species (e.g., water) at physically meaningful locations.

The mass source/sink method exchanges fluid mass between the differentspecies at certain locations. In some examples, this is done whilemaintaining a constant thermodynamic pressure during the exchange. Insome examples, the region where the mass exchange occurs is selectedbased on the flow rate of the species to be replaced. For example, inthe oil and water system, regions where there is a relatively high flowrate (S=ƒ(α)) such as the most convective zones within the system orzones with a flow rate exceeding a threshold can be selected as regionsfor mass exchange to occur. Once the exchange regions have beenidentified, in the identified exchange regions a portion of the oil isremoved from the region and replaced by the water to modify thesaturation level.

While oil and water have been described as the first and second speciesabove, the methods described herein can be applied to any set ofmultiple, different species.

This approach for simulating multi-species porous media flow may be usedin conjunction with a time-explicit CFD/CAA solution method based on theLattice Boltzmann Method (LBM), such as the PowerFLOW system availablefrom Exa Corporation of Burlington, Mass. Unlike methods based ondiscretizing the macroscopic continuum equations, LBM starts from a“mesoscopic” Boltzmann kinetic equation to predict macroscopic fluiddynamics. The resulting compressible and unsteady solution method may beused for predicting a variety of complex flow physics, such asaeroacoustics and pure acoustics problems. A general discussion of aLBM-based simulation system is provided below and followed by adiscussion of a scalar solving approach that may be used in conjunctionwith fluid flow simulations to support such a modeling approach.

B. Model Simulation Space

In a LBM-based physical process simulation system, fluid flow may berepresented by the distribution function values ƒ_(i), evaluated at aset of discrete velocities c_(i). The dynamics of the distributionfunction is governed by Equation 4 where ƒ_(i)(0) is known as theequilibrium distribution function, defined as:

$\begin{matrix}{f_{\alpha}^{(0)} = {w_{\alpha}{\rho \lbrack {1 + u_{\alpha} + \frac{u_{\alpha}^{2} - u^{2}}{2} + \frac{u_{\alpha}( {u_{\alpha}^{2} - {3u^{2}}} )}{6}} \rbrack}}} & {{Eq}.\mspace{14mu} (4)}\end{matrix}$

where

$u_{\alpha} = {\frac{c_{i}\overset{.}{u}}{T}.}$

$\begin{matrix}{{{f_{i}( {{\underset{\_}{x} + {\underset{\_}{e}}_{i}},{t + 1}} )} - {f_{i}( {\underset{\_}{x},t} )}} = {\frac{1}{\tau}\lbrack {{f_{i}( {\underset{\_}{x},t} )} - {f_{i}^{({eq})}( {\underset{\_}{x},t} )}} \rbrack}} & {{Eq}.\mspace{14mu} (5)}\end{matrix}$

This equation is the well-known lattice Boltzmann equation that describethe time-evolution of the distribution function, ƒ_(i). The left-handside represents the change of the distribution due to the so-called“streaming process.” The streaming process is when a pocket of fluidstarts out at a grid location, and then moves along one of the velocityvectors to the next grid location. At that point, the “collisionoperator,” i.e., the effect of nearby pockets of fluid on the startingpocket of fluid, is calculated. The fluid can only move to another gridlocation, so the proper choice of the velocity vectors is necessary sothat all the components of all velocities are multiples of a commonspeed.

The right-hand side of the first equation is the aforementioned“collision operator” which represents the change of the distributionfunction due to the collisions among the pockets of fluids. Theparticular form of the collision operator used here is due to Bhatnagar,Gross and Krook (BGK). It forces the distribution function to go to theprescribed values given by the second equation, which is the“equilibrium” form.

From this simulation, conventional fluid variables, such as mass ρ andfluid velocity u, are obtained as simple summations in Equation (3).Here, the collective values of c_(i) and w_(i) define a LBM model. TheLBM model can be implemented efficiently on scalable computer platformsand run with great robustness for time unsteady flows and complexboundary conditions.

A standard technique of obtaining the macroscopic equation of motion fora fluid system from the Boltzmann equation is the Chapman-Enskog methodin which successive approximations of the full Boltzmann equation aretaken.

In a fluid system, a small disturbance of the density travels at thespeed of sound. In a gas system, the speed of the sound is generallydetermined by the temperature. The importance of the effect ofcompressibility in a flow is measured by the ratio of the characteristicvelocity and the sound speed, which is known as the Mach number.

Referring to FIG. 4, a first model (2D-1) 100 is a two-dimensional modelthat includes 21 velocities. Of these 21 velocities, one (105)represents particles that are not moving; three sets of four velocitiesrepresent particles that are moving at either a normalized speed (r)(110-113), twice the normalized speed (2r) (120-123), or three times thenormalized speed (3r) (130-133) in either the positive or negativedirection along either the x or y axis of the lattice; and two sets offour velocities represent particles that are moving at the normalizedspeed (r) (140-143) or twice the normalized speed (2r) (150-153)relative to both of the x and y lattice axes.

As also illustrated in FIG. 5, a second model (3D-1) 200 is athree-dimensional model that includes 39 velocities, where each velocityis represented by one of the arrowheads of FIG. 5. Of these 39velocities, one represents particles that are not moving; three sets ofsix velocities represent particles that are moving at either anormalized speed (r), twice the normalized speed (2r), or three timesthe normalized speed (3r) in either the positive or negative directionalong the x, y or z axis of the lattice; eight represent particles thatare moving at the normalized speed (r) relative to all three of the x,y, z lattice axes; and twelve represent particles that are moving attwice the normalized speed (2r) relative to two of the x, y, z latticeaxes.

More complex models, such as a 3D-2 model includes 101 velocities and a2D-2 model includes 37 velocities also may be used.

For the three-dimensional model 3D-2, of the 101 velocities, onerepresents particles that are not moving (Group 1); three sets of sixvelocities represent particles that are moving at either a normalizedspeed (r), twice the normalized speed (2r), or three times thenormalized speed (3r) in either the positive or negative direction alongthe x, y or z axis of the lattice (Groups 2, 4, and 7); three sets ofeight represent particles that are moving at the normalized speed (r),twice the normalized speed (2r), or three times the normalized speed(3r) relative to all three of the x, y, z lattice axes (Groups 3, 8, and10); twelve represent particles that are moving at twice the normalizedspeed (2r) relative to two of the x, y, z lattice axes (Group 6); twentyfour represent particles that are moving at the normalized speed (r) andtwice the normalized speed (2r) relative to two of the x, y, z latticeaxes, and not moving relative to the remaining axis (Group 5); andtwenty four represent particles that are moving at the normalized speed(r) relative to two of the x, y, z lattice axes and three times thenormalized speed (3r) relative to the remaining axis (Group 9).

For the two-dimensional model 2D-2, of the 37 velocities, one representsparticles that are not moving (Group 1); three sets of four velocitiesrepresent particles that are moving at either a normalized speed (r),twice the normalized speed (2r), or three times the normalized speed(3r) in either the positive or negative direction along either the x ory axis of the lattice (Groups 2, 4, and 7); two sets of four velocitiesrepresent particles that are moving at the normalized speed (r) or twicethe normalized speed (2r) relative to both of the x and y lattice axes;eight velocities represent particles that are moving at the normalizedspeed (r) relative to one of the x and y lattice axes and twice thenormalized speed (2r) relative to the other axis; and eight velocitiesrepresent particles that are moving at the normalized speed (r) relativeto one of the x and y lattice axes and three times the normalized speed(3r) relative to the other axis.

The LBM models described above provide a specific class of efficient androbust discrete velocity kinetic models for numerical simulations offlows in both two- and three-dimensions. A model of this kind includes aparticular set of discrete velocities and weights associated with thosevelocities. The velocities coincide with grid points of Cartesiancoordinates in velocity space which facilitates accurate and efficientimplementation of discrete velocity models, particularly the kind knownas the lattice Boltzmann models. Using such models, flows can besimulated with high fidelity.

Referring to FIG. 6, a physical process simulation system operatesaccording to a procedure 300 to simulate a physical process such asfluid flow. Prior to the simulation, a simulation space is modeled as acollection of voxels (step 302). Typically, the simulation space isgenerated using a computer-aided-design (CAD) program. For example, aCAD program could be used to draw an micro-device positioned in a windtunnel. Thereafter, data produced by the CAD program is processed to adda lattice structure having appropriate resolution and to account forobjects and surfaces within the simulation space.

The resolution of the lattice may be selected based on the Reynoldsnumber of the system being simulated. The Reynolds number is related tothe viscosity (v) of the flow, the characteristic length (L) of anobject in the flow, and the characteristic velocity (u) of the flow:

Re=uL/v.  Eq. (6)

The characteristic length of an object represents large scale featuresof the object. For example, if flow around a micro-device were beingsimulated, the height of the micro-device might be considered to be thecharacteristic length. When flow around small regions of an object(e.g., the side mirror of an automobile) is of interest, the resolutionof the simulation may be increased, or areas of increased resolution maybe employed around the regions of interest. The dimensions of the voxelsdecrease as the resolution of the lattice increases.

The state space is represented as ƒ_(i)(x, t), where ƒ_(i) representsthe number of elements, or particles, per unit volume in state i (i.e.,the density of particles in state i) at a lattice site denoted by thethree-dimensional vector x at a time t. For a known time increment, thenumber of particles is referred to simply as ƒ_(i)(x). The combinationof all states of a lattice site is denoted as ƒ(x).

The number of states is determined by the number of possible velocityvectors within each energy level. The velocity vectors consist ofinteger linear speeds in a space having three dimensions: x, y, and z.The number of states is increased for multiple-species simulations.

Each state i represents a different velocity vector at a specific energylevel (i.e., energy level zero, one or two). The velocity c_(i) of eachstate is indicated with its “speed” in each of the three dimensions asfollows:

c _(i)=(c _(i,x) ,c _(i,y) ,c _(i,z))  Eq. (7)

The energy level zero state represents stopped particles that are notmoving in any dimension, i.e. C_(stopped)=(0, 0, 0). Energy level onestates represents particles having a ±1 speed in one of the threedimensions and a zero speed in the other two dimensions. Energy leveltwo states represent particles having either a ±1 speed in all threedimensions, or a ±2 speed in one of the three dimensions and a zerospeed in the other two dimensions.

Generating all of the possible permutations of the three energy levelsgives a total of 39 possible states (one energy zero state, 6 energy onestates, 8 energy three states, 6 energy four states, 12 energy eightstates and 6 energy nine states.).

Each voxel (i.e., each lattice site) is represented by a state vectorf(x). The state vector completely defines the status of the voxel andincludes 39 entries. The 39 entries correspond to the one energy zerostate, 6 energy one states, 8 energy three states, 6 energy four states,12 energy eight states and 6 energy nine states. By using this velocityset, the system can produce Maxwell-Boltzmann statistics for an achievedequilibrium state vector.

For processing efficiency, the voxels are grouped in 2×2×2 volumescalled microblocks. The microblocks are organized to permit parallelprocessing of the voxels and to minimize the overhead associated withthe data structure. A short-hand notation for the voxels in themicroblock is defined as N_(i)(n), where n represents the relativeposition of the lattice site within the microblock and nε{0, 1, 2, . . ., 7}. A microblock is illustrated in FIG. 7.

Referring to FIGS. 8A and 8B, a surface S is represented in thesimulation space (FIG. 8B) as a collection of facets F_(α):

S={F _(α)}  Eq. (8)

where α is an index that enumerates a particular facet. A facet is notrestricted to the voxel boundaries, but is typically sized on the orderof or slightly smaller than the size of the voxels adjacent to the facetso that the facet affects a relatively small number of voxels.Properties are assigned to the facets for the purpose of implementingsurface dynamics. In particular, each facet F_(α) has a unit normal(n_(α)), a surface area (A_(α)), a center location (x_(α)), and a facetdistribution function (ƒ_(i)(α)) that describes the surface dynamicproperties of the facet.

Referring to FIG. 9, different levels of resolution may be used indifferent regions of the simulation space to improve processingefficiency. Typically, the region 650 around an object 655 is of themost interest and is therefore simulated with the highest resolution.Because the effect of viscosity decreases with distance from the object,decreasing levels of resolution (i.e., expanded voxel volumes) areemployed to simulate regions 660, 665 that are spaced at increasingdistances from the object 655. Similarly, as illustrated in FIG. 10, alower level of resolution may be used to simulate a region 770 aroundless significant features of an object 775 while the highest level ofresolution is used to simulate regions 780 around the most significantfeatures (e.g., the leading and trailing surfaces) of the object 775.Outlying regions 785 are simulated using the lowest level of resolutionand the largest voxels.

C. Identify Voxels Affected by Facets

Referring again to FIG. 6, once the simulation space has been modeled(step 302), voxels affected by one or more facets are identified (step304). Voxels may be affected by facets in a number of ways. First, avoxel that is intersected by one or more facets is affected in that thevoxel has a reduced volume relative to non-intersected voxels. Thisoccurs because a facet, and material underlying the surface representedby the facet, occupies a portion of the voxel. A fractional factorP_(f)(x) indicates the portion of the voxel that is unaffected by thefacet (i.e., the portion that can be occupied by a fluid or othermaterials for which flow is being simulated). For non-intersectedvoxels, P_(f)(x) equals one.

Voxels that interact with one or more facets by transferring particlesto the facet or receiving particles from the facet are also identifiedas voxels affected by the facets. All voxels that are intersected by afacet will include at least one state that receives particles from thefacet and at least one state that transfers particles to the facet. Inmost cases, additional voxels also will include such states.

Referring to FIG. 11, for each state i having a non-zero velocity vectorc_(i), a facet F_(α) receives particles from, or transfers particles to,a region defined by a parallelepiped G_(iα) having a height defined bythe magnitude of the vector dot product of the velocity vector c_(i) andthe unit normal n_(α) of the facet (|c_(i)n_(i)|) and a base defined bythe surface area A_(α) of the facet so that the volume V_(iα) of theparallelepiped G_(iα) equals:

V _(iα) =|c _(i) n _(α) |A _(α)  Eq. (9)

The facet F_(α) receives particles from the volume V_(iα) when thevelocity vector of the state is directed toward the facet(|c_(i)n_(i)|<0), and transfers particles to the region when thevelocity vector of the state is directed away from the facet(|c_(i)n_(i)|>0). As will be discussed below, this expression must bemodified when another facet occupies a portion of the parallelepipedG_(iα), a condition that could occur in the vicinity of non-convexfeatures such as interior corners.

The parallelepiped G_(iα) of a facet F_(α) may overlap portions or allof multiple voxels. The number of voxels or portions thereof isdependent on the size of the facet relative to the size of the voxels,the energy of the state, and the orientation of the facet relative tothe lattice structure. The number of affected voxels increases with thesize of the facet. Accordingly, the size of the facet, as noted above,is typically selected to be on the order of or smaller than the size ofthe voxels located near the facet.

The portion of a voxel N(x) overlapped by a parallelepiped G_(iα) isdefined as V_(iα)(x). Using this term, the flux Γ_(iα)(x) of state iparticles that move between a voxel N(x) and a facet F_(α) equals thedensity of state i particles in the voxel (N_(i)(x)) multiplied by thevolume of the region of overlap with the voxel (V_(iα)(x)):

Γ_(iα)(x)=N _(i)(x)V _(iα)(x).  Eq. (10)

When the parallelepiped G_(iα) is intersected by one or more facets, thefollowing condition is true:

V _(iα) =ΣV _(α)(x)+ΣV _(iα)(β)  Eq. (11)

where the first summation accounts for all voxels overlapped by G_(iα)and the second term accounts for all facets that intersect G_(iα). Whenthe parallelepiped G_(iα) is not intersected by another facet, thisexpression reduces to:

V _(iα) =ΣV _(iα)(x).  Eq. (12)

D. Perform Simulation

Once the voxels that are affected by one or more facets are identified(step 304), a timer is initialized to begin the simulation (step 306).During each time increment of the simulation, movement of particles fromvoxel to voxel is simulated by an advection stage (steps 308-316) thataccounts for interactions of the particles with surface facets. Next, acollision stage (step 318) simulates the interaction of particles withineach voxel. Thereafter, the timer is incremented (step 320). If theincremented timer does not indicate that the simulation is complete(step 322), the advection and collision stages (steps 308-320) arerepeated. If the incremented timer indicates that the simulation iscomplete (step 322), results of the simulation are stored and/ordisplayed (step 324).

1. Boundary Conditions for Surface

To correctly simulate interactions with a surface, each facet must meetfour boundary conditions. First, the combined mass of particles receivedby a facet must equal the combined mass of particles transferred by thefacet (i.e., the net mass flux to the facet must equal zero). Second,the combined energy of particles received by a facet must equal thecombined energy of particles transferred by the facet (i.e., the netenergy flux to the facet must equal zero). These two conditions may besatisfied by requiring the net mass flux at each energy level (i.e.,energy levels one and two) to equal zero.

The other two boundary conditions are related to the net momentum ofparticles interacting with a facet. For a surface with no skin friction,referred to herein as a slip surface, the net tangential momentum fluxmust equal zero and the net normal momentum flux must equal the localpressure at the facet. Thus, the components of the combined received andtransferred momentums that are perpendicular to the normal n, of thefacet (i.e., the tangential components) must be equal, while thedifference between the components of the combined received andtransferred momentums that are parallel to the normal n, of the facet(i.e., the normal components) must equal the local pressure at thefacet. For non-slip surfaces, friction of the surface reduces thecombined tangential momentum of particles transferred by the facetrelative to the combined tangential momentum of particles received bythe facet by a factor that is related to the amount of friction.

2. Gather from Voxels to Facets

As a first step in simulating interaction between particles and asurface, particles are gathered from the voxels and provided to thefacets (step 308). As noted above, the flux of state i particles betweena voxel N(x) and a facet F_(α) is:

Γ_(iα)(x)=N _(i)(x)V _(iα)(x).  Eq. (13)

From this, for each state i directed toward a facet F_(α)(c_(i)n_(α)<0),the number of particles provided to the facet F_(α) by the voxels is:

$\begin{matrix}\begin{matrix}{\Gamma_{{i\; \alpha \; V}arrow F} = {\sum\limits_{x}^{\;}{\Gamma_{i\; \alpha}(x)}}} \\{= {\sum\limits_{x}^{\;}{{N_{i}(x)}{V_{i\; \alpha}(x)}}}}\end{matrix} & {{Eq}.\mspace{14mu} (14)}\end{matrix}$

Only voxels for which V_(iα)(x) has a non-zero value must be summed. Asnoted above, the size of the facets is selected so that V_(iα)(x) has anon-zero value for only a small number of voxels. Because V_(iα)(x) andP_(f)(x) may have non-integer values, Γ_(α)(x) is stored and processedas a real number.

3. Move from Facet to Facet

Next, particles are moved between facets (step 310). If theparallelepiped G_(iα) for an incoming state (c_(i)n_(α)<0) of a facetF_(α) is intersected by another facet F_(β), then a portion of the statei particles received by the facet F_(α) will come from the facet F_(β).In particular, facet F_(α) will receive a portion of the state iparticles produced by facet F_(β) during the previous time increment.This relationship is illustrated in FIG. 13, where a portion 1000 of theparallelepiped G_(iα) that is intersected by facet F_(p) equals aportion 1005 of the parallelepiped G_(iβ) that is intersected by facetF_(α). As noted above, the intersected portion is denoted as V_(iα)(β).Using this term, the flux of state i particles between a facet F_(β) anda facet F_(α) may be described as:

Γ_(iα)(β,t−1)=Γ_(i)(β)V _(iα)(β)/V _(iα)  Eq. (15)

where Γ_(i)(β, t−1) is a measure of the state i particles produced bythe facet F_(β) during the previous time increment. From this, for eachstate i directed toward a facet F_(α)(c_(i)n_(α)<0), the number ofparticles provided to the facet F_(α) by the other facets is:

$\begin{matrix}\begin{matrix}{\Gamma_{{i\; \alpha \; F}arrow F} = {\sum\limits_{\beta}^{\;}{\Gamma_{i\; \alpha}(\beta)}}} \\{= {\sum\limits_{\beta}^{\;}{{\Gamma_{i}( {\beta,{t - 1}} )}{{V_{i\; \alpha}(\beta)}/V_{i\; \alpha}}}}}\end{matrix} & {{Eq}.\mspace{14mu} (16)}\end{matrix}$

and the total flux of state i particles into the facet is:

$\begin{matrix}\begin{matrix}{{\Gamma_{iIN}(\alpha)} = {\Gamma_{{i\; \alpha \; V}arrow F} + \Gamma_{{i\; \alpha \; F}arrow F}}} \\{= {{\sum\limits_{x}^{\;}{{N_{i}(x)}{V_{i\; \alpha}(x)}}} + {\sum\limits_{\beta}^{\;}{{\Gamma_{i}( {\beta,{t - 1}} )}{{V_{i\; \alpha}(\beta)}/V_{i\; \alpha}}}}}}\end{matrix} & {{Eq}.\mspace{14mu} (17)}\end{matrix}$

The state vector N(α) for the facet, also referred to as a facetdistribution function, has M entries corresponding to the M entries ofthe voxel states vectors. M is the number of discrete lattice speeds.The input states of the facet distribution function N(α) are set equalto the flux of particles into those states divided by the volume V_(iα):

N _(i)(α)=Γ_(iIN)(α)/V _(iα)  Eq. (18)

for c_(i)n_(α)<0.

The facet distribution function is a simulation tool for generating theoutput flux from a facet, and is not necessarily representative ofactual particles. To generate an accurate output flux, values areassigned to the other states of the distribution function. Outwardstates are populated using the technique described above for populatingthe inward states:

N _(i)(α)=Γ_(iOTHER)(α)/V  Eq. (19)

for c_(i)n_(α)≧0, wherein Γ_(iOTHER)(α) is determined using thetechnique described above for generating Γ_(iIN)(α), but applying thetechnique to states (c_(i)n_(α)≧0) other than incoming states(c_(i)n_(α)<0)). In an alternative approach, Γ_(iOTHER)(α) may begenerated using values of Γ_(iOUT)(α) from the previous time step sothat:

Γ_(iOTHER)(α,t)=Γ_(iOUT)(α,t−1).  Eq. (20)

For parallel states (c_(i)n_(α)=0), both V_(iα) and V_(iα)(x) are zero.In the expression for N_(i) (α), V_(iα)(x) appears in the numerator(from the expression for Γ_(iOTHER) (a) and V_(iα) appears in thedenominator (from the expression for N_(i)(α)). Accordingly, N_(i)(α)for parallel states is determined as the limit of N_(i)(α) as V_(iα) andV_(iα)(x) approach zero.

The values of states having zero velocity (i.e., rest states and states(0, 0, 0, 2) and (0, 0, 0, −2)) are initialized at the beginning of thesimulation based on initial conditions for temperature and pressure.These values are then adjusted over time.

4. Perform Facet Surface Dynamics

Next, surface dynamics are performed for each facet to satisfy the fourboundary conditions discussed above (step 312). A procedure forperforming surface dynamics for a facet is illustrated in FIG. 14.Initially, the combined momentum normal to the facet F_(α) is determined(step 1105) by determining the combined momentum P(α) of the particlesat the facet as:

$\begin{matrix}{{P(\alpha)} = {\sum\limits_{i}^{\;}{c_{i}*N_{i}^{\alpha}}}} & {{Eq}.\mspace{14mu} (21)}\end{matrix}$

for all i. From this, the normal momentum P_(n)(α) is determined as:

P _(n)(α)=n _(α) ·P(α).  Eq. (22)

This normal momentum is then eliminated using a pushing/pullingtechnique (step 1110) to produce N_(n-)(α). According to this technique,particles are moved between states in a way that affects only normalmomentum. The pushing/pulling technique is described in U.S. Pat. No.5,594,671, which is incorporated by reference.

Thereafter, the particles of N_(n-)(α) are collided to produce aBoltzmann distribution N_(n-β)(α) (step 1115). As described below withrespect to performing fluid dynamics, a Boltzmann distribution may beachieved by applying a set of collision rules to N_(n-)(α).

An outgoing flux distribution for the facet F_(α) is then determined(step 1120) based on the incoming flux distribution and the Boltzmanndistribution. First, the difference between the incoming fluxdistribution Γ_(i)(α) and the Boltzmann distribution is determined as:

ΔΓ_(i)(α)=Γ_(iIN)(α)−N _(n-βi)(α)V _(iα)  Eq. (23)

Using this difference, the outgoing flux distribution is:

Γ_(iOUT)(α)=N _(n-βi)(α)V _(iα)−·Δ·Γ_(i)*(α),  Eq. (24)

for n_(α)c_(i)>0 and where i* is the state having a direction oppositeto state i. For example, if state i is (1, 1, 0, 0), then state i* is(−1, −1, 0, 0). To account for skin friction and other factors, theoutgoing flux distribution may be further refined to:

Γ_(iOUT)(α)=N _(n-Bi)(α)V _(iα)−ΔΓ_(i*)(α)+

C _(f)(n _(α) ·c _(i))[N _(n-Bi*)(α)−N _(n-Bi)(α)]V _(iα)+

(n _(α) ·c _(i))(t _(lα) ·c _(i))ΔN _(j,l) V_(iα)+(n_(α)·c_(i))(t_(2α)·c_(i))ΔN_(j,2)V_(iα)  Eq. (25)

for n_(α)c_(i)>0, where c_(ƒ) is a function of skin friction, t_(iα) isa first tangential vector that is perpendicular to n_(α), t_(2α), is asecond tangential vector that is perpendicular to both n_(α) and t_(1α),and ΔN_(j,1) and ΔN_(j,2) are distribution functions corresponding tothe energy (j) of the state i and the indicated tangential vector. Thedistribution functions are determined according to:

$\begin{matrix}{{\Delta \; N_{j,1,2}} = {{- \frac{1}{2j^{2}}}( {n_{\alpha} \cdot {\sum\limits_{i}^{\;}{c_{i}c_{i}{{N_{n - {Bi}}(\alpha)} \cdot t_{1,{2\alpha}}}}}} )}} & {{Eq}.\mspace{14mu} (26)}\end{matrix}$

where j equals 1 for energy level 1 states and 2 for energy level 2states.

The functions of each term of the equation for Γ_(iOUT)(α) are asfollows. The first and second terms enforce the normal momentum fluxboundary condition to the extent that collisions have been effective inproducing a Boltzmann distribution, but include a tangential momentumflux anomaly. The fourth and fifth terms correct for this anomaly, whichmay arise due to discreteness effects or non-Boltzmann structure due toinsufficient collisions. Finally, the third term adds a specified amountof skin fraction to enforce a desired change in tangential momentum fluxon the surface. Generation of the friction coefficient C_(ƒ) isdescribed below. Note that all terms involving vector manipulations aregeometric factors that may be calculated prior to beginning thesimulation.

From this, a tangential velocity is determined as:

u _(i)(α)=(P(α)−P _(n)(α)n _(α))/ρ,  Eq. (27)

where ρ is the density of the facet distribution:

$\begin{matrix}{\rho = {\sum\limits_{i}^{\;}{N_{i}(\alpha)}}} & {{Eq}.\mspace{14mu} (28)}\end{matrix}$

As before, the difference between the incoming flux distribution and theBoltzmann distribution is determined as:

ΔΓ_(i)(α)=Γ_(iIN)(α)−N _(n-βi)(α)V _(iα)  Eq. (29)

The outgoing flux distribution then becomes:

Γ_(iOUT)(α)=N _(n-βi)(α)V _(iα)−ΔΓ_(i*)(α)+C _(f)(n _(α) c _(i))[N_(n-βi*)(α)−N _(n-βi)(α)]V _(iα)  Eq. (30)

which corresponds to the first two lines of the outgoing fluxdistribution determined by the previous technique but does not requirethe correction for anomalous tangential flux.

Using either approach, the resulting flux-distributions satisfy all ofthe momentum flux conditions, namely:

$\begin{matrix}{{{\sum\limits_{i,{{c_{i} \cdot n_{\alpha}} > 0}}^{\;}{c_{i}\Gamma_{i\; {\alpha {OUT}}}}} - {\sum\limits_{i,{{c_{i} \cdot n_{\alpha}} < 0}}^{\;}{c_{i}\Gamma_{i\; \alpha \; {IN}}}}} = {{p_{\alpha}n_{\alpha}A_{\alpha}} - {C_{f}p_{\alpha}u_{\alpha}A_{\alpha}}}} & {{Eq}.\mspace{14mu} (31)}\end{matrix}$

where β_(α) is the equilibrium pressure at the facet F_(α) and is basedon the averaged density and temperature values of the voxels thatprovide particles to the facet, and u_(α) is the average velocity at thefacet.

To ensure that the mass and energy boundary conditions are met, thedifference between the input energy and the output energy is measuredfor each energy level jas:

${\Delta\Gamma}_{\alpha \; {mj}} = {{\sum\limits_{i,{{c_{ji} \cdot n_{\alpha}} < 0}}^{\;}\Gamma_{\alpha \; {jiIN}}} - {\sum\limits_{i,{{c_{ji} \cdot n_{\alpha}} > 0}}^{\;}{c_{i}\Gamma_{i\; {\alpha {OUT}}}}}}$

Eq. (32)

where the index j denotes the energy of the state i. This energydifference is then used to generate a difference term:

$\begin{matrix}{{\delta\Gamma}_{\alpha \; {ji}} = {V_{i\; \alpha}{{\Delta\Gamma}_{\alpha \; {mj}}/{\sum\limits_{i,{{c_{ji} \cdot n_{\alpha}} < 0}}^{\;}V_{i\; \alpha}}}}} & {{Eq}.\mspace{14mu} (33)}\end{matrix}$

for c_(ji)n_(α)>0. This difference term is used to modify the outgoingflux so that the flux becomes:

Γ_(αjiOUTƒ)=Γ_(αjiOUT)+∂δΓ_(αji)  Eq. (34)

for c_(ji)n_(α)>0. This operation corrects the mass and energy fluxwhile leaving the tangential momentum flux unaltered. This adjustment issmall if the flow is approximately uniform in the neighborhood of thefacet and near equilibrium. The resulting normal momentum flux, afterthe adjustment, is slightly altered to a value that is the equilibriumpressure based on the neighborhood mean properties plus a correction dueto the non-uniformity or non-equilibrium properties of the neighborhood.

5. Move from Voxels to Voxels

Referring again to FIG. 6, particles are moved between voxels along thethree-dimensional rectilinear lattice (step 314). This voxel to voxelmovement is the only movement operation performed on voxels that do notinteract with the facets (i.e., voxels that are not located near asurface). In typical simulations, voxels that are not located nearenough to a surface to interact with the surface constitute a largemajority of the voxels.

Each of the separate states represents particles moving along thelattice with integer speeds in each of the three dimensions: x, y, andz. The integer speeds include: 0, ±1, and ±2. The sign of the speedindicates the direction in which a particle is moving along thecorresponding axis.

For voxels that do not interact with a surface, the move operation iscomputationally quite simple. The entire population of a state is movedfrom its current voxel to its destination voxel during every timeincrement. At the same time, the particles of the destination voxel aremoved from that voxel to their own destination voxels. For example, anenergy level 1 particle that is moving in the +1x and +1y direction (1,0, 0) is moved from its current voxel to one that is +1 over in the xdirection and 0 for other direction. The particle ends up at itsdestination voxel with the same state it had before the move (1, 0, 0).Interactions within the voxel will likely change the particle count forthat state based on local interactions with other particles andsurfaces. If not, the particle will continue to move along the latticeat the same speed and direction.

The move operation becomes slightly more complicated for voxels thatinteract with one or more surfaces. This can result in one or morefractional particles being transferred to a facet. Transfer of suchfractional particles to a facet results in fractional particlesremaining in the voxels. These fractional particles are transferred to avoxel occupied by the facet. For example, referring to FIG. 12, when aportion 900 of the state i particles for a voxel 905 is moved to a facet910 (step 308), the remaining portion 915 is moved to a voxel 920 inwhich the facet 910 is located and from which particles of state i aredirected to the facet 910. Thus, if the state population equaled 25 andV_(iα)(x) equaled 0.25 (i.e., a quarter of the voxel intersects theparallelepiped G_(iα)), then 6.25 particles would be moved to the facetF_(α) and 18.75 particles would be moved to the voxel occupied by thefacet F_(α). Because multiple facets could intersect a single voxel, thenumber of state i particles transferred to a voxel N(ƒ) occupied by oneor more facets is:

$\begin{matrix}{{N_{i}(f)} = {{N_{i}(x)}( {1 - {\sum\limits_{\alpha}^{\;}\; {V_{i\; \alpha}(x)}}} )}} & {{Eq}.\mspace{14mu} (35)}\end{matrix}$

where N(x) is the source voxel.

6. Scatter from Facets to Voxels

Next, the outgoing particles from each facet are scattered to the voxels(step 316). Essentially, this step is the reverse of the gather step bywhich particles were moved from the voxels to the facets. The number ofstate i particles that move from a facet F_(α) to a voxel N(x) is:

$\begin{matrix}{N_{{\alpha \; {iF}}arrow V} = {\frac{1}{P_{f}(x)}{V_{\alpha \; i}(x)}{\Gamma_{\alpha \; {iOUT}_{f}}/V_{\alpha \; i}}}} & {{Eq}.\mspace{14mu} (36)}\end{matrix}$

where P_(f)(x) accounts for the volume reduction of partial voxels. Fromthis, for each state i, the total number of particles directed from thefacets to a voxel N_((x)) is:

$\begin{matrix}{N_{{iF}arrow V} = {\frac{1}{P_{f}(x)}{\sum\limits_{\alpha}^{\;}\; {{V_{\alpha \; i}(x)}{\Gamma_{\alpha \; {iOUT}_{f}}/V_{\alpha \; i}}}}}} & {{Eq}.\mspace{14mu} (37)}\end{matrix}$

After scattering particles from the facets to the voxels, combining themwith particles that have advected in from surrounding voxels, andintegerizing the result, it is possible that certain directions incertain voxels may either underflow (become negative) or overflow(exceed 255 in an eight-bit implementation). This would result in eithera gain or loss in mass, momentum and energy after these quantities aretruncated to fit in the allowed range of values. To protect against suchoccurrences, the mass, momentum and energy that are out of bounds areaccumulated prior to truncation of the offending state. For the energyto which the state belongs, an amount of mass equal to the value gained(due to underflow) or lost (due to overflow) is added back to randomly(or sequentially) selected states having the same energy and that arenot themselves subject to overflow or underflow. The additional momentumresulting from this addition of mass and energy is accumulated and addedto the momentum from the truncation. By only adding mass to the sameenergy states, both mass and energy are corrected when the mass counterreaches zero. Finally, the momentum is corrected using pushing/pullingtechniques until the momentum accumulator is returned to zero.

7. Perform Fluid Dynamics

Finally, fluid dynamics are performed (step 318). This step may bereferred to as microdynamics or intravoxel operations. Similarly, theadvection procedure may be referred to as intervoxel operations. Themicrodynamics operations described below may also be used to collideparticles at a facet to produce a Boltzmann distribution.

The fluid dynamics is ensured in the lattice Boltzmann equation modelsby a particular collision operator known as the BGK collision model.This collision model mimics the dynamics of the distribution in a realfluid system. The collision process can be well described by theright-hand side of Equation 1 and Equation 2. After the advection step,the conserved quantities of a fluid system, specifically the density,momentum and the energy are obtained from the distribution functionusing Equation 3. From these quantities, the equilibrium distributionfunction, noted by ƒ^(eq) in equation (2), is fully specified byEquation (4). The choice of the velocity vector set c_(i), the weights,both are listed in Table 1, together with Equation 2 ensures that themacroscopic behavior obeys the correct hydrodynamic equation.

E. Variable Resolution

Referring to FIG. 15, variable resolution (as illustrated in FIGS. 9 and10 and discussed above) employs voxels of different sizes, hereinafterreferred to as coarse voxels 12000 and fine voxels 1205. (The followingdiscussion refers to voxels having two different sizes; it should beappreciated that the techniques described may be applied to three ormore different sizes of voxels to provide additional levels ofresolution.) The interface between regions of coarse and fine voxels isreferred to as a variable resolution (VR) interface 1210.

When variable resolution is employed at or near a surface, facets mayinteract with voxels on both sides of the VR interface. These facets areclassified as VR interface facets 1215 (F_(αIC)) or VR fine facets 1220(F_(αIF)). A VR interface facet 1215 is a facet positioned on the coarseside of the VR interface and having a coarse parallelepiped 1225extending into a fine voxel. (A coarse parallelepiped is one for whichc_(i) is dimensioned according to the dimensions of a coarse voxel,while a fine parallelepiped is one for which c_(i) is dimensionedaccording to the dimensions of a fine voxel.) A VR fine facet 1220 is afacet positioned on the fine side of the VR interface and having a fineparallelepiped 1230 extending into a coarse voxel. Processing related tointerface facets may also involve interactions with coarse facets 1235(F_(αC)) and fine facets 1240 (F_(αF)).

For both types of VR facets, surface dynamics are performed at the finescale, and operate as described above. However, VR facets differ fromother facets with respect to the way in which particles advect to andfrom the VR facets.

Interactions with VR facets are handled using a variable resolutionprocedure 1300 illustrated in FIG. 16. Most steps of this procedure arecarried out using the comparable steps discussed above for interactionswith non-VR facets. The procedure 1300 is performed during a coarse timestep (i.e., a time period corresponding to a coarse voxel) that includestwo phases that each correspond to a fine time step. The facet surfacedynamics are performed during each fine time step. For this reason, a VRinterface facet F_(αIC) is considered as two identically sized andoriented fine facets that are referred to, respectively, as a blackfacet F_(αICb) and a red facet F_(αICr). The black facet F_(αICb) isassociated with the first fine time step within a coarse time step whilethe red facet F_(αICr) is associated with the second fine time stepwithin a coarse time step.

Initially, particles are moved (advected) between facets by a firstsurface-to-surface advection stage (step 1302). Particles are moved fromblack facets F_(αICb) to coarse facets F_(βC) with a weighting factor ofV_(-αβ) that corresponds to the volume of the unblocked portion of thecoarse parallelepiped (FIG. 15, 1225) that extends from a facet F_(α)and that lies behind a facet F_(β) less the unblocked portion of thefine parallelepiped (FIG. 15, 1245) that extends from the facet F_(α)and that lies behind the facet F_(β). The magnitude of c_(i) for a finevoxel is one half the magnitude of c_(i) for a coarse voxel. Asdiscussed above, the volume of a parallelepiped for a facet F_(α) isdefined as:

V _(iα) =|c _(i) n _(α) |A _(α)  Eq. (38)

Accordingly, because the surface area A_(α) of a facet does not changebetween coarse and fine parallelepipeds, and because the unit normaln_(α) always has a magnitude of one, the volume of a fine parallelepipedcorresponding to a facet is one half the volume of the correspondingcoarse parallelepiped for the facet.

Particles are moved from coarse facets F_(αC) to black facets F_(βICb)with a weighting factor of V_(αβ) that corresponds to the volume of theunblocked portion of the fine parallelepiped that extends from a facetF_(α) and that lies behind a facet F_(β).

Particles are moved from red facets F_(αICr) to coarse facets F_(βC)with a weighting factor of V_(αβ), and from coarse facets F_(αC) to redfacets F_(αICr) with a weighting factor of V_(−αβ).

Particles are moved from red facets F_(αICr) to black facets F_(αICb)with a weighting factor of V_(αβ). In this stage, black-to-redadvections do not occur. In addition, because the black and red facetsrepresent consecutive time steps, black-to-black advections (orred-to-red advections) never occur. For similar reasons, particles inthis stage are moved from red facets F_(αICr) to fine facets F_(βIF) orF_(βF) with a weighting factor of V_(αβ), and from fine facets F_(αIF)or F_(αF) to black facets F_(αICb) with the same weighting factor.

Finally, particles are moved from fine facets F_(αIF) or F_(αF) to otherfine facets F_(βIF) or F_(βF), with the same weighting factor, and fromcoarse facets F_(αC) to other coarse facets F_(C) with a weightingfactor of V_(Cαβ) that corresponds to the volume of the unblockedportion of the coarse parallelepiped that extends from a facet F_(α) andthat lies behind a facet F_(β).

After particles are advected between surfaces, particles are gatheredfrom the voxels in a first gather stage (steps 1304-1310). Particles aregathered for fine facets F_(αF) from fine voxels using fineparallelepipeds (step 1304), and for coarse facets F_(αC) from coarsevoxels using coarse parallelepipeds (step 1306). Particles are thengathered for black facets F_(αIRb) and for VR fine facets F_(αIF) fromboth coarse and fine voxels using fine parallelepipeds (step 1308).Finally, particles are gathered for red facets F_(αIRr) from coarsevoxels using the differences between coarse parallelepipeds and fineparallelepipeds (step 1310).

Next, coarse voxels that interact with fine voxels or VR facets areexploded into a collection of fine voxels (step 1312). The states of acoarse voxel that will transmit particles to a fine voxel within asingle coarse time step are exploded. For example, the appropriatestates of a coarse voxel that is not intersected by a facet are explodedinto eight fine voxels oriented like the microblock of FIG. 7. Theappropriate states of coarse voxel that is intersected by one or morefacets are exploded into a collection of complete and/or partial finevoxels corresponding to the portion of the coarse voxel that is notintersected by any facets. The particle densities N_(i)(x) for a coarsevoxel and the fine voxels resulting from the explosion thereof areequal, but the fine voxels may have fractional factors P_(f) that differfrom the fractional factor of the coarse voxel and from the fractionalfactors of the other fine voxels.

Thereafter, surface dynamics are performed for the fine facets F_(αIF)and F (step 1314), and for the black facets F_(αICb) (step 1316).Dynamics are performed using the procedure illustrated in FIG. 14 anddiscussed above.

Next, particles are moved between fine voxels (step 1318) includingactual fine voxels and fine voxels resulting from the explosion ofcoarse voxels. Once the particles have been moved, particles arescattered from the fine facets F_(αIF) and F_(αF) to the fine voxels(step 1320).

Particles are also scattered from the black facets F_(αICb) to the finevoxels (including the fine voxels that result from exploding a coarsevoxel) (step 1322). Particles are scattered to a fine voxel if the voxelwould have received particles at that time absent the presence of asurface. In particular, particles are scattered to a voxel N(x) when thevoxel is an actual fine voxel (as opposed to a fine voxel resulting fromthe explosion of a coarse voxel), when a voxel N(x+c_(i)) that is onevelocity unit beyond the voxel N(x) is an actual fine voxel, or when thevoxel N(x+c_(i)) that is one velocity unit beyond the voxel N(x) is afine voxel resulting from the explosion of a coarse voxel.

Finally, the first fine time step is completed by performing fluiddynamics on the fine voxels (step 1324). The voxels for which fluiddynamics are performed do not include the fine voxels that result fromexploding a coarse voxel (step 1312).

The procedure 1300 implements similar steps during the second fine timestep. Initially, particles are moved between surfaces in a secondsurface-to-surface advection stage (step 1326). Particles are advectedfrom black facets to red facets, from black facets to fine facets, fromfine facets to red facets, and from fine facets to fine facets.

After particles are advected between surfaces, particles are gatheredfrom the voxels in a second gather stage (steps 1328-1330). Particlesare gathered for red facets F_(αIRr) from fine voxels using fineparallelepipeds (step 1328). Particles also are gathered for fine facetsF_(αβ) and F_(αIF) from fine voxels using fine parallelepipeds (step1330).

Thereafter, surface dynamics are performed for the fine facets F_(αIF)and F_(αβ) (step 1332), for the coarse facets F_(αC) (step 1134), andfor the red facets F_(αICr) (step 1336) as discussed above.

Next, particles are moved between voxels using fine resolution (step1338) so that particles are moved to and from fine voxels and finevoxels representative of coarse voxels. Particles are then moved betweenvoxels using coarse resolution (step 1340) so that particles are movedto and from coarse voxels.

Next, in a combined step, particles are scattered from the facets to thevoxels while the fine voxels that represent coarse voxels (i.e., thefine voxels resulting from exploding coarse voxels) are coalesced intocoarse voxels (step 1342). In this combined step, particles arescattered from coarse facets to coarse voxels using coarseparallelepipeds, from fine facets to fine voxels using fineparallelepipeds, from red facets to fine or coarse voxels using fineparallelepipeds, and from black facets to coarse voxels using thedifferences between coarse parallelepipeds and find parallelepipeds.Finally, fluid dynamics are performed for the fine voxels and the coarsevoxels (step 1344).

F. Mass Exchange

As noted above, various types of LBM may be applied for solving fluidflows, which serve as the background for multi-species flow throughporous media. In some systems, to achieve relative permeabilitypredictions, a set of gravity driven periodic-setup simulations could beperformed at different saturations using a mass sink/source method inwhich fluid mass is exchanged between the different species at certainlocations. In this manner the saturation can be changed while much ofthe spatial distribution of the fluid species from the previoussaturation condition remains unchanged; hence information from thesimulation results at one saturation condition influences the simulationat another saturation condition. For example, if a simulation progressesfor a period of time and then oil is exchanged for water at certainlocations, this changes the saturation value, while the oil and waterdistribution at all other locations is preserved. More particularly, ateach water saturation, the simulation will be run until the effectivepermeabilities converge. After convergence, the mass exchange will beginand the simulation will be run until the next desired water saturationlevel is achieved. Once the desired water saturation level is achieved,the last exchange will be turned off and the simulation will run untilthe effective permeabilities converge. Thus, the system alternatesbetween a mass exchange simulation and a convergence simulation.

FIG. 17 is a flow chart of an exemplary process for using a massexchange process to modify the saturation value for a system duringsimulation of a multi-species flow through porous media. The processgenerates relative permeability predictions for the various saturationvalues. The relative permeability curves are an important input toestimate the productivity of a hydrocarbon reservoir. The twoend-points, the irreducible water saturation (Swi) and the residual oilsaturation (Sor), enable an estimation of the amount of oil which can beproduced (by taking the difference in saturation values between Sor andSwi), as well as the amount of oil which cannot be extracted (Sor). Theshape of the relative permeability curve, and the relation between therelative permeability curve of water and oil, provide knowledge as tohow easy it is to move oil in the presence of water and are criticalinputs to reservoir modeling systems used throughout the oil and gasindustry.

The process begins with obtaining information about porous medium (1410)and generating a 3-D digital representation of porous medium (1412). Forexample, the porous media sample can be captured digitally, typicallyvia a CT or micro-CT scanning process. Analysis and processing of theresulting images can be used to generate a three-dimensional digitalrepresentation of the porous medium geometry (e.g., a porous rock) foruse in a numerical flow simulation.

The computer system then initializes the gravity driven periodic system(1414). In a gravity driven periodic system, a body force is applied inthe desired flow direction to move the fluid through the simulation.Additionally, there is no inlet or outlet for the fluid to enter andexit, but rather the fluid leaving one end of the domain immediatelyenters at the other end. The system is also initialized to a particularsaturation level or to a particular fluid distribution corresponding toa certain S_(w). In order to connect inlet and outlet, the rock geometryis mirrored in the flow direction. This means that the pore spaceprofile at the outlet is identical to the geometry of the inlet. Thereare two methods to start an imbibition type of relative permeabilitycalculation. In this explanation, both methods assume water and oil tobe the two immiscible fluids and the rock to be water wet. In the firstmethod, the entire pore space is initialized with oil (S_(w)=0%) andwater is introduced into the rock using the mass sink/source exchangemechanism, such that Sw is increased incrementally. The irreduciblewater saturation is then determined as the saturation S_(w) when thewater flow rate first becomes non-zero. A more accurate approach is toperform a drainage simulation. In such a simulation a rock is initiallyfully saturated with water (S_(w)=100%). Then, oil is pushed into thepore space on one side with an incrementally increasing pressure suchthat the final pressure corresponds to the pressure under reservoirconditions. The pressure at the inlet is increased in small incrementsin such a way that the oil intrusion comes to a rest (converges) beforethe next pressure increment is applied. The result of such a drainagetest is a relation between the Capillary pressure and the correspondingwater saturation. The water saturation at the largest pressure isconsidered to be the irreducible water saturation S_(w), and can then beused as the starting point of a relative permeability test. Thedistribution of the water component can be used as the initial waterdistribution of the relative permeability test.

After initialization of the system, a simulation is executed untilsteady state is obtained (1416). The simulation typically starts with asaturation value at one extreme of the important saturation range. Atthis extreme saturation value typically only a single species is flowingthrough the porous media while the other species is present butmotionless (trapped). When the simulation for this condition reaches asteady state, the relative permeabilities are determined (1418). Therelative permeability of each component is calculated as the ratio ofthe effective permeability for that component divided by the absolutepermeability:

$k_{r,\alpha} = \frac{k_{{eff},\alpha}}{k_{0}}$

with α indicating the water or oil component. The absolute permeabilitycan be determined in a single-phase flow simulation of the same rockgeometry, or can be defined as the effective permeability at theirreducible water saturation S_(wi). The equation for the effectivepermeability can be written as follows:

$k_{{eff},\alpha} = {\mu_{\alpha} \cdot q_{\alpha} \cdot {\frac{L}{\Delta \; P}.}}$

Replacing the dynamic viscosity with the product of the kinematicviscosity and the density μ=v·ρ, and replacing the flux with the productof measured mean velocity in pore space with the porosity q=u·Φ, leadsto

$k_{{eff},\alpha} = {\Phi \cdot u_{\alpha} \cdot \rho_{\alpha} \cdot v_{\alpha} \cdot {\frac{L}{\Delta \; P}.}}$

For gravity driven periodic systems, the pressure head

$\frac{\Delta \; P}{L}$

can be replaced with the product of gravity and density:

$\frac{\Delta \; P}{L} = {\rho \cdot g}$

Plugging this expression in the equation for the effective permeabilityleads to

$k_{{eff},\alpha} = {\Phi \cdot {\frac{v_{\alpha} \cdot u_{\alpha}}{g}.}}$

This equation is calculated for every voxel in the simulation domain andthen averaged across the entire simulation domain.

The system then determines whether there are additional saturationlevels to simulate (1420). If there are additional saturation levels tosimulate, the system begins a process in which mass is exchanged betweenspecies 1422. In this process, at each mass exchange location, onespecies is removed and equal mass of the other species is injected. Thismass exchange process changes the saturation from the starting value toa new value. One example of such an exchange process is described inmore detail in relation to FIG. 18. In general, the mass exchange isdone at appropriate high flow rate locations over a sufficient volume toachieve the next desired saturation condition (1424). When thesaturation condition is satisfied, the mass exchange is turned off(1426) and the simulation is continued until again reaching steady state(1416).

The saturation is not updated each time step, rather, it is only updatedafter enough timesteps have run to reach convergence. This process isrepeated over the desired set of saturation values. In this manner thesystems and methods described herein allow the entire range ofsaturation values to be traversed while incorporating the influence ofthe fluid species distribution from one saturation value to the next. Inthis way, history effects are captured in the relative permeabilityresults, allowing the simulation approach to more accurately reproducewhat happens in the corresponding physical test situation. Given thepotential for simulations predicting relative permeability to have lowercost and take less time than physical testing, a multi-species porousmedia simulation method employing the present mass sink/source processis expected to have value to the petroleum exploration and productionindustry.

In one particular example of an oil/water simulation, the mass exchangecan be based on the following equations:

S_(oil) = −α H(u − u₀)H(A − A₀)ρ S_(water) = −S_(oil)ρ = ρ_(oil), α > 0 ρ = ρ_(water), α ≤ 0$A = \frac{\rho_{oil} - \rho_{water}}{\rho_{oil} + \rho_{water}}$

The sink term for the oil component S_(oil), is a function of theexchange rate α with the unit of 1/timesteps, a Heaviside function tocontrol the threshold velocity, a Heaviside function to identify voxelsbelonging to the oil component using a Atwood number criterion, and thedensity of the oil component. A large exchange rate a will consequentlylead to a larger fraction of exchanged mass per time step. The Heavisidefunction which is applied to the velocity vector ensures that a certainthreshold velocity u₀ must be exceeded in order to identify thatparticular fluid volume as a volume which is part of a convection zone.The Atwood number is a parameter used to identify the components. Itranges between −1 and +1 corresponding to water and oil. The secondHeaviside function ensures that the fluid volume which is considered forexchange is filled mostly with oil. The threshold value for the Atwoodnumber A₀ is typically close to −1, e.g. smaller than 0.95. Themagnitude of the mass source term of the water component S_(water) isset equal to the magnitude of the mass sink term of the oil componentmultiplied by −1. However, in some examples the mass of the source termcould instead be determined by a different constraint, for example,maintaining constant pressure per unit volume.

The choice of locations for the mass exchange in the simulated porousrock sample is important. In a physical steady-state relativepermeability experiment, the saturation is set by injecting thecorresponding combination of fluids into the porous media (i.e. with amixture ratio that will result in the desired saturation value). Forexample, in what is termed an imbibition process, a rock sampleinitially filled mostly with oil is injected with a water and oilmixture having a mixture ratio with a higher volume fraction of water.This injection increases the saturation of water within the porous mediaby replacing some oil filled regions with water. In this physicalsituation, the porous media regions with the highest local flow ratesare the first ones to have oil replaced by water, and over time thereplacement happens also in regions with lower local flow rates.

FIG. 18 shows an exemplary process for determining locations for themass exchange and performing the mass exchange to reach the targetsaturation level. To reproduce the effects of the above describedphysical process in simulation, the regions of exchange (where the masssink/source is applied) are selected to be those where there is arelatively high flow rate of the species to be replaced (e.g., regionsof high oil flow in the above example). More particularly, the systemobtains information about velocity vectors for voxels (1510) andidentifies voxels for mass exchange (1512) based on the velocity vectorinformation. In one example, a threshold velocity value can be stored bythe system and any voxel having a velocity in excess of the thresholdcan be selected for mass exchange. In another example, the set ofvelocity vectors can be ranked and a predetermined percentage of voxels(e.g., about 10%) can be selected having the highest velocity values. Inanother example the exchange rate can be defined as a function of thelocal velocity, e.g. a fast moving oil blob will be exchanged fastercompared to a slow moving oil blob. Thus, the system identifies theconvective zones based on the velocity vectors and performs massexchange in the identified convective zones. Mass exchange is notperformed in the non-convective zones of the system. Fluid that isnon-mobile (e.g., trapped within a pore or inaccessible) is not replacedbecause the velocity in such regions will be low or near zero.

Once an exchange region is identified, the species designated to bereduced are removed from that region and replaced by one (or more) ofthe species designated to be increased (1514). In the exchange region,the mass exchange is performed by providing both a source that inputsthe species that is desired to be increased in the system and a sinkthat removes the species that is desired to be reduced. In the case ofequal mass exchange, the source inputs a mass of the first species equalto the mass of the second species that is removed from the voxel by thesink. As described earlier the fluid density is calculate as the sumover all density distributions

${f_{i}\rho} = {\sum\limits_{i}^{\;}\; {f_{i}.}}$

All post-propagation density distributions are scaled in the followingway:

$f_{i,{oil}}^{MSS} = {f_{i,{oil}} \cdot {\frac{\rho + S_{oil}}{\rho}.}}$

Please note that S_(oil) is negative which means that the density of oilis reduced in an imbibition process. Assuming that the mean waterdensity is identical to the mean oil density the set of densitydistributions of the water component is the modified similarly:

$f_{i,{water}}^{MSS} = {f_{i,{water}} \cdot {\frac{\rho - S_{oil}}{\rho}.}}$

For example, in an oil and water system, water replaces oil. Theexchange occurs over multiple time steps with only a small portion(e.g., 0.1-0.3% 0.01%-0.03%) of the mass of a voxel being changed duringa single time step. In other examples, larger exchange rates are alsopossible. Thus, modifying a system's saturation by 10% could take over1000 time steps in the simulation. After replacing the portion of themass, the system runs one or more time steps of fluid flow simulation(1516) and determines whether the target saturation value has beenreached. If so, the system ends the mass exchange (1520). If not, thesystem returns to exchanging the species at step 1514. In anotherexample, the system monitors the saturation throughout the entireexchange process and will detect when the target saturation value hasbeen reached.

While in the example described above, the system replaced the sameamount of mass in each of the identified voxels, in some examples, theexchange amount can be based on the velocity vectors on a per voxelbasis. For example, the mass can be exchanged at a greater rate in thezones with greater velocity vectors. In some examples, the mass exchangerate is directly proportional to the velocity vector for the voxel.

While in the examples described above, a velocity vector was used todetermine the convective zones eligible for mass exchange, and someadditional examples other values indicating movement of componentswithin the system/voxel could be used. Instead of velocity, a locationcriterion could be introduced as an alternative criterion to allow theexchange process. Such location information could be obtained fromanother simulation or from a pore size distribution analysis (e.g.exchange only fluids within a percolation path).

Embodiments can be implemented in digital electronic circuitry, or incomputer hardware, firmware, software, or in combinations thereof.Apparatus of the techniques described herein can be implemented in acomputer program product tangibly embodied or stored in amachine-readable media (e.g., storage device) for execution by aprogrammable processor; and method actions can be performed by aprogrammable processor executing a program of instructions to performoperations of the techniques described herein by operating on input dataand generating output. The techniques described herein can beimplemented in one or more computer programs that are executable on aprogrammable system including at least one programmable processorcoupled to receive data and instructions from, and to transmit data andinstructions to, a data storage system, at least one input device, andat least one output device. Each computer program can be implemented ina high-level procedural or object oriented programming language, or inassembly or machine language if desired; and in any case, the languagecan be a compiled or interpreted language.

Suitable processors include, by way of example, both general and specialpurpose microprocessors. Generally, a processor will receiveinstructions and data from a read-only memory and/or a random accessmemory. Generally, a computer will include one or more mass storagedevices for storing data files; such devices include magnetic disks,such as internal hard disks and removable disks; magneto-optical disks;and optical disks. Storage devices suitable for tangibly embodyingcomputer program instructions and data include all forms of non-volatilememory, including by way of example semiconductor memory devices, suchas EPROM, EEPROM, and flash memory devices; magnetic disks such asinternal hard disks and removable disks; magneto-optical disks; andCD_ROM disks. Any of the foregoing can be supplemented by, orincorporated in, ASICs (application-specific integrated circuits).

A number of implementations have been described. Nevertheless, it willbe understood that various modifications may be made without departingfrom the spirit and scope of the claims. Accordingly, otherimplementations are within the scope of the following claims.

What is claimed is:
 1. A method for simulating a fluid flow on acomputer, the method comprising: simulating, using one or moreprocessors, activity of a multi-phase fluid that includes a firstspecies and a second species in a volume, the activity of the fluid inthe volume being simulated so as to model movement of elements withinthe volume; determining a relative permeability of the first species inthe volume for a first saturation value; removing, from identifiedexchange regions, a first mass of the first species and replacing thefirst mass of the first species with a second mass of the second speciesto modify a saturation value for the volume; simulating activity of themulti-phase fluid based on the modified saturation value; anddetermining a relative permeability of the first species in the volumebased on the modified saturation value.
 2. The method of claim 1,further comprising: determining a relative permeability of the secondspecies in the volume for the first saturation value; and determining arelative permeability of the second species in the volume based on themodified saturation value.
 3. The method of claim 1, further comprisingidentifying the exchange regions in the volume, based on a valueindicative of movement of the first species within the volume.
 4. Themethod of claim 3, wherein identifying the exchange regions comprisesidentifying a set of convective voxels.
 5. The method of claim 4,wherein identifying the convective voxels in the volume comprisesidentifying voxels having a high flow rate of the first species.
 6. Themethod of claim 4, wherein identifying the convective voxels in thevolume comprises identifying voxels in which a velocity exceeds athreshold.
 7. The method of claim 4, wherein identifying the convectivevoxels in the volume comprises ranking voxels based on their associatedvelocity and selecting a portion of the voxels having the greatestvelocity.
 8. The method of claim 3, wherein removing the first mass ofthe first species and replacing the first mass of the first species withthe second mass of the second species comprises replacing the first massof the first species with an equal mass of the second species.
 9. Themethod of claim 1, wherein removing, from the identified exchangeregions, the first mass of the first species and replacing the firstmass of the first species with the equal mass of the second speciescomprises performing a mass exchange process over multiple time stepsuntil a desired saturation value is obtained.
 10. The method of claim 1,wherein simulating the activity of the multi-phase fluid comprisessimulating the activity of the multi-phase fluid until the effectivepermeabilities converge.
 11. The method of claim 1, wherein the firstspecies comprises oil and the second species comprises water.
 12. Themethod of claim 1, wherein the volume comprises a porous media volume.13. The method of claim 1, wherein simulating the activity of themulti-phase fluid comprises simulating the activity of the multi-phasefluid in a periodic domain using a gravity driven simulation.
 14. Themethod of claim 1, wherein simulating activity of the fluid in thevolume comprises: performing interaction operations on the statevectors, the interaction operations modeling interactions betweenelements of different momentum states according to a model; andperforming first move operations of the set of state vectors to reflectmovement of elements to new voxels in the volume according to the model.15. A method for estimating the productivity of a hydrocarbon reservoir,the method comprising: simulating activity of a multi-phase fluid thatincludes at least oil and water in a hydrocarbon reservoir, the activityof the fluid in the hydrocarbon reservoir being simulated so as to modelmovement of elements within the hydrocarbon reservoir; determining arelative permeability of oil and a relative permeability of water in thehydrocarbon reservoir for a first saturation value; removing, fromidentified exchange regions, a first mass of the oil and replacing thefirst mass of the oil with a second mass of water to modify a saturationvalue for the volume; simulating activity of the multi-phase fluid basedon the modified saturation value; and determining a relativepermeability of oil and a relative permeability of water in thehydrocarbon reservoir based on the modified saturation value; estimatingof the amount of oil which can be produced from the hydrocarbonreservoir based on the determined relative permeabilities.
 16. Acomputer program product tangibly embodied in a computer readablemedium, the computer program product including instructions that, whenexecuted, simulate a physical process fluid flow, the computer programproduct configured to cause a computer to: simulate activity of amulti-phase fluid that includes a first species and a second species ina volume, the activity of the fluid in the volume being simulated so asto model movement of elements within the volume; determine a relativepermeability of the first species in the volume for a first saturationvalue; remove, from identified exchange regions, a first mass of thefirst species and replacing the first mass of the first species with asecond mass of the second species to modify a saturation value for thevolume; simulate activity of the multi-phase fluid based on the modifiedsaturation value; and determine a relative permeability of the firstspecies in the volume based on the modified saturation value.
 17. Thecomputer program product of claim 16, further configured to identify theexchange regions in the volume, based on a value indicative of movementof the first species within the volume.
 18. The computer program productof claim 17, wherein the configurations to identify the exchange regionscomprise configurations to identify a set of convective voxels.
 19. Thecomputer program product of claim 18, wherein the configurations toidentify the convective voxels in the volume comprise configurations toidentify voxels having a high flow rate of the first species.
 20. Thecomputer program product of claim 18, wherein the configurations toidentify the convective voxels in the volume comprise configurations toidentify voxels in which a velocity exceeds a threshold.
 21. Thecomputer program product of claim 18, wherein the configurations toidentify the convective voxels in the volume comprise configurations torank voxels based on their associated velocity and select a portion ofthe voxels having the greatest velocity.
 22. The computer programproduct of claim 17, wherein the configurations to remove the first massof the first species and replace the first mass of the first specieswith the second mass of the second species comprise configurations toreplace the first mass of the first species with an equal mass of thesecond species.
 23. The computer program product of claim 17, whereinthe first species comprises oil and the second species comprises waterand the volume comprises a porous media volume.
 24. The computer programproduct of claim 16, wherein the configurations to simulate the activityof the multi-phase fluid comprise configurations to simulate theactivity of the multi-phase fluid in a periodic domain using a gravitydriven simulation.
 25. A computer system for simulating a physicalprocess fluid flow, the system being configured to: simulate activity ofa multi-phase fluid that includes a first species and a second speciesin a volume, the activity of the fluid in the volume being simulated soas to model movement of elements within the volume; determine a relativepermeability of the first species in the volume for a first saturationvalue; remove, from identified exchange regions, a first mass of thefirst species and replacing the first mass of the first species with asecond mass of the second species to modify a saturation value for thevolume; simulate activity of the multi-phase fluid based on the modifiedsaturation value; and determine a relative permeability of the firstspecies in the volume based on the modified saturation value.
 26. Thesystem of claim 25, further configured to identify the exchange regionsin the volume, based on a value indicative of movement of the firstspecies within the volume.
 27. The system of claim 26, wherein theconfigurations to identify the exchange regions comprise configurationsto identify a set of convective voxels.
 28. The system of claim 27,wherein the configurations to identify the convective voxels in thevolume comprise configurations to identify voxels having a high flowrate of the first species.
 29. The system of claim 27, wherein theconfigurations to identify the convective voxels in the volume compriseconfigurations to identify voxels in which a velocity exceeds athreshold.
 30. The system of claim 27, wherein the configurations toidentify the convective voxels in the volume comprise configurations torank voxels based on their associated velocity and select a portion ofthe voxels having the greatest velocity.
 31. The system of claim 26,wherein the configurations to remove the first mass of the first speciesand replace the first mass of the first species with the second mass ofthe second species comprise configurations to replace the first mass ofthe first species with an equal mass of the second species.
 32. Thesystem of claim 25, wherein the first species comprises oil and thesecond species comprises water and the volume comprises a porous mediavolume.
 33. The system of claim 25, wherein the configurations tosimulate the activity of the multi-phase fluid comprise configurationsto simulate the activity of the multi-phase fluid in a periodic domainusing a gravity driven simulation.